<?php
require_once("../../class2.php");
require_once(HEADERF);
require_once("./includes/require_all.php");
ramka("open");
?>
<script>
	function insertFromURL(url,from,into) {
		$(into).load(url+' '+from);
	};
</script>
<?php

$catgame=intval($_GET['catgame']);
$cg=mysql_fetch_array(mysql_query("SELECT * FROM gcs_main WHERE prefix='$catgame'"));
$cgresend=$cg[Prefix];
$youtube=explode("?v=", $cg[YouTube]);
$cgYouTube="http://www.youtube.com/embed/".$youtube[1];

$cg[LastChange]= months_inBG(date("j F Y : H:i", strtotime($cg[LastChange])));

echo "<div class='forumheader3'>";
	if(in_array(USERNAME,$mods,true)){
		echo "<h1 class='forumheader3 textWHITE'><center>$cg[Game] <a href='gts-edit.php?gname=$catgame' style='color:red;font-size:16px;'>EDIT</a></center></h1>";
	}
	else{
		echo "<h1 class='forumheader3 textWHITE'><center>$cg[Game]</center></h1>";
	}
echo "<table width=100% class='forumheader3'>
		<tr>
		<td class='forumheader3' width=30%><center><img src='gts/covers/$cg[Cover]' height=250px style='vertical-align:middle; margin-top:3px;'/></center></td>
		<td style='vertical-align:top;'>
			<table width=100%>
				<tr>
				<td class='forumheader3' width=30%> Година</td>
				<td class='forumheader'>$cg[Year]</td>
				</tr>
				<tr>
				<td class='forumheader3' width=30%> Разработчик</td>
				<td class='forumheader'>$cg[Developper]</td>
				</tr>
				<tr>
				<td class='forumheader3' width=30%> Платформа</td>
				<td class='forumheader'>$cg[Platform]</td>
				</tr>				
				<tr>
				<td class='forumheader3' width=30%> Жанр</td>
				<td class='forumheader'>$cg[Ganre]</td>
				</tr>
			</table>
		</td>
		</tr>
	</table>
	</div>
	<table width=100% class='forumheader3'>
		<tr>
		<td width=70%>
			<div class='forumheader3'> За играта</div>
			<div class='forumheader textGREY'>$cg[Info]</div>&nbsp;&nbsp;
			<div>&nbsp;&nbsp;<iframe width='458' height='250' src='$cgYouTube' frameborder='0' allowfullscreen></iframe><div>
			<div class='forumheader3'></div>
			<br>
			<div id='mygamess2'></div>
			<script>insertFromURL('gts-game-exec2.php?cg=$cgresend', '#result', '#mygamess2');</script>
			<br>
			<table width=100%>
				<tr>
				<td class='forumheader3' width=33%><center> Добавено от:</center></td>
				<td class='forumheader3' width=33%><center> Преглеждания:</center></td>
				<td class='forumheader3' width=33%><center> Последна редакция:</center></td>
				</tr>
				<tr>
				<td class='forumheader'><center>$cg[AddedBy]</center></td>
				<td class='forumheader'><center>$cg[Seen]</center></td>
				<td class='forumheader'><center>$cg[LastChange]</center></td>
				</tr>
			</table>
			<div class='forumheader3'></div>
		</td>
		<td class='forumheader3' style='vertical-align:top;'>
			<div class='forumheader3'><center>Минимални изисквания</center></div>
			<center class='forumheader' style='font-weight:normal'>
				Операционна система:<br>$cg[MinOS]<br>
				Процесор:<br>$cg[MinProc]<br>
				РАМ памет:<br>$cg[MinRAM]<br>
				Видео карта:<br>$cg[MinVGA]<br>
				Твърд диск:<br>$cg[MinHDS]<br>
			</center>
			<br>
			<div id='mygamess'></div>
			<script>insertFromURL('gts-game-exec.php?cg=$cgresend', '#result', '#mygamess');</script>
		</td>
		</tr>
	</table>";

mysql_query("UPDATE gcs_main SET Seen=Seen+1 WHERE prefix='$cgresend'");

ramka("close");
require_once(FOOTERF);
?>